<?php
namespace exception;

class BaseException extends \Exception
{
    protected $data;

    public function __construct($message = null, int $code = 0, $previous = null, $data = []) {
        $this->data = $data;

        if (!empty($message) && is_string($message)) {
            parent::__construct($message, $code, $previous);
        } else {
            $msg = isset(self::$errorMessages[$code]) ? self::$errorMessages[$code] : '错误代码:'.$code;

            parent::__construct($msg, $code, $previous);
        }
    }

    public function getData() {
        return $this->data;
    }

    const HTTP_NOT_FOUND                      = 404;
    const HTTP_INTERNAL_ERROR                 = 500;
    

    const PUSH_TO_QUEUE_FAILED                = 600;
    const PARAMS_MISSING                      = 601;
    const DATA_ABNORMAL                       = 602;
    const BAD_VALIDATOR_PARAMS                = 700;
    const HTTP_METHOD_OPTION                  = 998;
    const BLACK_LIST_USER                     = 701; // 该用户已经被锁定，详情请联系客服
    const FORBID_NIGHT_TRADE                  = 702; // 非交易时间(晚上23点至第二日上午9点)，不支持此操作
    const  NOT_LOGIN                          = 4004;//用户未登录
    const SYS_MAINTAIN                        = 99001; // 维护模式
    const SYS_FORCE_UPGRADE                   = 99002; // 强制升级模式
    const API_DELETED                         = 99003; // 接口已停止使用

    // 2000 - 2999 异常 Code，仅供短信模块使用，其他模块请勿占用 START
    const ERR_SMS_CAPTCHA_MAX_DAY                    = 2001;
    const ERR_SMS_CAPTCHA_FREQUENCE                  = 2002;   //短信验证码发送请求过于频繁
    const ERR_SMS_CAPTCHA_SEND_ERROR                 = 2003;   //调用短信接口发送验证码失败
    const ERR_SMS_CAPTCHA_OVERDUE                    = 2004;   //短信验证码已经过期
    const ERR_SMS_CAPTCHA_MAX_ERROR_TIMES            = 2005;   //短信验证码超过最大错误次数
    const ERR_SMS_CAPTCHA_INCORRECT                  = 2006;   //短信验证码错误
    const ERR_SMS_PHONE_MISSING                      = 2007;   //手机号码缺失
    const ERR_SMS_PHONE_ERROR                        = 2008;   //手机号码非法
    const ERR_SMS_TYPE_ERROR                         = 2009;   //短信类别非法
    const ERR_SMS_TYPE_MISSING                       = 2010;   //短信类别缺失
    const ERR_SMS_TYPE_PARAMETER_ERROR               = 2011;   //短信参数格式非法
    const ERR_SMS_TYPE_PARAMETER_MISSING             = 2012;   //短信参数缺失
    const ERR_SMS_TYPE_TEMPLATE_MISSING              = 2013;   //短信模版缺失
    const ERR_SMS_CAPTCHA_ERROR                      = 2014;   //短信验证码错误
    const ERR_SMS_SEND_RECORD_ERROR                  = 2015;
    const ERR_SEND_SMS_FAILED                        = 2016;
    const ERR_READ_MESSAGE_FIELD                     = 2017;
    const ERR_SMS_IN_BLACKLIST                       = 2018;
    const ERR_MESSAGE_NOT_FIND                       = 2019;
    const PASSWORD_FAILD_FIVE_TIMES                  = 2020;
    const ERR_SMS_PHONE_EXISTED                      = 2021;   //手机号码已存在
    const ERR_SMS_PHONE_NOT_EXISTS                   = 2022;   //手机号码不存在

    // 2000 - 2999 异常 Code，仅供短信模块使用，其他模块请勿占用 END

    // 3000 - 3999 债权交易模块异常占用 START
    const DEBT_INVEST_FAILED                        = 3000; // 投资失败
    const DEBT_PRODUCT_PLAN_UNVAILABLE              = 3001; // 产品计划不可投
    const DEBT_PRODUCT_PLAN_NOT_ENOUGH              = 3002; // 产品计划额度不足
    const DEBT_PRODUCT_PLAN_AMOUNT_TOO_SMALL        = 3003; // 产品计划投资额度过小
    const DEBT_PRODUCT_PLAN_AMOUNT_TOO_LARGE        = 3004; // 产品计划投资额度过大
    const DEBT_PRODUCT_PLAN_AMOUNT_NOT_ALLOW        = 3005; // 产品计划投资额度不满足限制
    const DEBT_BORROWER_NOT_FOUND                   = 3006; // 借款人没找到
    const DEBT_BORROWER_ALREADY_EXISTS              = 3007; // 借款人已存在
    const DEBT_CONTRACT_NUMBER_CONFLICTED           = 3008; // 借款合同已存在
    const DEBT_TRADE_ORDER_NOT_FOUND                = 3009; // 投资订单未找到
    const DEBT_TRADE_ORDER_MATCH_COMPLETE           = 3010; // 投资订单已完成撮合
    const DEBT_TRADE_ORDER_CAN_NOT_TO_MATCH         = 3011; // 投资订单状态不是待撮合
    const DEBT_TRADE_ORDER_BANK_SYNC_FAILED         = 3012; // 投资订单存管同步告知失败
    const DEBT_POOL_CHANGE_STATUS_FAILED            = 3013; // 债权份额状态变更失败
    const DEBT_PRODUCT_YIELD_NOT_IN_SECTION         = 3014; // 计划利率不在区间之内
    const DEBT_MATCH_FAILED                         = 3015; // 债权匹配失败
    const DEBT_NO_BESPEAK_POWER                     = 3016; // 没有预约权限
    const DEBT_TRADE_NOT_EXISTS                     = 3017; // 投资订单不存在
    const DEBT_INVEST_HANDLE_EXC_FAST               = 3018; // 订单处理过快
    const DEBT_INVEST_TRANSFER_NOT_FOUND            = 3019; // 无债转记录
    const DEBT_FILLIN_PARAM_INCORRECT               = 3701; // 债权录入参数错误(债权录入错误从3700 - 3799)
    const DEBT_ONLINE_PARAM_INCORRECT               = 3801; // 债权上线参数错误(债权上线错误从3800 - 3899)
    const DEBT_ONLINE_TO_REL_FAILED                 = 3802; // 债权上线加入Rel表失败
    const DEBT_ONLINE_GEN_REPAY_PLAN_FAILED         = 3802; // 债权上线生成还款计划失败
    const DEBT_ONLINE_ADD_PRODUCT_AMOUNT_FAILED     = 3803; // 债权上线新增计划(产品)剩余金额失败
    const DEBT_ONLINE_CHANGE_STATE_FAILED           = 3804; // 债权上线更新债权到状态到上线(募集中)状态失败
    const DEBT_CANNOT_LOAN                          = 3805; // 债权未找到或不符合放款条件
    const DEBT_NO_POOL_TO_LOAN                      = 3806; // 没有找到可放款的认购份额
    const DEBT_ONLINE_NO_CORRECT_DEBTS              = 3807; // 没有满足条件的债权可用于上线
    const DEBT_REPAY_PLAN_CALC_FAILED               = 3901; // 计算还款计划错误(还款计划错误从3900 - 3999)
    const DEBT_REPAY_PLAN_LIST_CALC_FAILED          = 3902; // 计算还款计划列表错误
    const DEBT_FILLIN_WITH_NOTHING                  = 3903; // 生成债权时数据丢失
    const DEBT_TRADE_ORDER_TO_MATCH_SUCCESS         = 3904; // 投资订单银行状态不是撮合成功
    const DEBT_NOT_FULL                             = 3905; // 债权还未募集满
    const DEBT_PRODUCT_NO_RECORD                    = 3906; // 产品表无记录
    const DEBT_NO_RECORD                            = 3907;  // 债权表无记录
    const DEBT_USER_IS_NOT_BORROWER                 = 3908; // 用户非借款人
    const DEBT_PRINCIPAL_OR_PERIODS_OR_RATE_OR_AGENCY_RATE_ERROR = 3909; // 债权的本金或期数或利率或机构费率有问题
    const DEBT_PAYBACK_COM_PERIOD_CANNOT_BE_GREATER_THAN_LOAN_DAYS = 3910; //
    const DEBT_AUDIT_STATUS_NOT_WAITING             = 3911; // 债权非待审核状态
    const DEBT_NOT_FOUND                            = 3912; // 债权未找到
    const LIQUID_INVEST_STOPED                      = 3913; // 零火宝已暂停预约
    // 3000 - 3999 债权交易模块异常占用 END

    // 4000 - 4999 异常 Code，仅供资金账户模块使用，其他模块请勿占用 START
    const ACCOUNT_MODULE_EXCEPTION                = 4000;
    const ACCOUNT_MODULE_PARAMS_MISSING           = 4001;
    const ACCOUNT_NOT_EXIST                       = 4101;
    const ACCOUNT_LOG_FLOW_NOT_ALLOWED            = 4201;
    const ACCOUNT_LOG_CHANGE_MONEY_ILLEGAL        = 4202;
    const ACCOUNT_FROZEN_MONEY_ILLEGAL            = 4203;
    const ACCOUNT_FROZEN_MONEY_ORDER_ID_NOT_EXIST = 4204;
    const ACCOUNT_FROZEN_MONEY_UNFREEZE_FAIL      = 4205;
    const ACCOUNT_FROZEN_MONEY_UNFREEZE_EXCEED    = 4206;
    const ACCOUNT_AVAIL_MONEY_LESS                = 4207;
    const ACCOUNT_FROZEN_MONEY_LESS               = 4208;
    const ACCOUNT_DICT_ITEM_NOT_IN_WHITE_LIST     = 4209;
    const ACCOUNT_INVESTED_MONEY_LESS             = 4230;
    const ACCOUNT_DB_OPERATION_ERROR              = 4501;
    const ACCOUNT_PASSWORD_MISSMATCH              = 4601;
    const ACCOUNT_LOGIN_NOT_FOUND                 = 4602;
    const ACCOUNT_USER_NOT_FOUND                  = 4603;
    const ACCOUNT_USER_NOT_LOGIN                  = 4604;
    const ACCOUNT_WRONG_CAPTCHA                   = 4605;
    const ACCOUNT_CHALLENGE_MAX_CAPTCHA           = 4606;
    const ACCOUNT_ALREADY_REALNAME                = 4607;

    const ACCOUNT_PAYPWD_ILLEGAL_FORMAT           = 4608;
    const ACCOUNT_PAYPWD_OPERION_FAIL           = 4609;
    const ACCOUNT_PREFER_OPERATION_FAIL             = 4610;

    const USER_WITHDRAW_NO_RECORD               = 4611;
    const ACCOUNT_BANK_CARD_LIMIT_NO_RECORD             = 4612;
    const USER_REGISTER_IDNUM_EXISTED             = 4613;
    const USER_KICKED                             = 4614;
    const USER_MOBILE_EXIST                       = 4615;
    const USER_NO_NEED_FOR_CAPTCHA                = 4616;
    const REALNAME_TIMES_LIMIT                    = 4617;
    const OPEN_BETA_FORBIDDEN_REGISTER            = 4618;//公测
    const REALNAME_FAIL                            = 4619;
    const ACCOUNT_INVEST_MONEY_LESS                = 4620;
    const BORROWER_AGENCY_NOT_EXIST                = 4624;//借款用户对应的机构不存在
    const BORROWER_OPENACCOUNT_PARAMS_ERROR        = 4621;//ump开户接口参数非法，type不存在
    const ADD_AGENCY_FAIL                       = 4622;//添加机构失败
    const FIELD_NOT_EXIST                       = 4623;//所属行业不存在
    const ACCOUNT_ZT_MONEY_LESS                = 4625;//在途金额不足
    const ACCOUNT_ARRIVAL_MONEY_LESS                = 4626;//到账金额不足
    const USER_INFO_NOT_FINISHED                  = 4627;



    // 4000 - 4999 异常 Code，仅供资金账户模块使用，其他模块请勿占用 END

    // 5000 - 5999 异常 Code，仅供差额结算系统使用，其他模块请勿占用 START
    const Maximoff_MODULE_EXCEPTION                 = 5000;
    const Maximoff_MODULE_PARAMS_MISSING            = 5001;
    const Maximoff_DATA_EXCEPTION                 = 5002;   // 无差额系统数据
    // 5000 - 5999 异常 Code，仅供差额结算系统使用，其他模块请勿占用 END
    
    //6000 - 6999 异常 Code，仅供派息使用，其他模块请勿占用 START
    const INTEREST_PARAM_EXCEPTION                  =  6001; //参数非法
    const INTEREST_DATA_EXCEPTION                   =  6002; //无计息数据
    const INTEREST_CREATE_EXCEPTION                 =  6003; //生成计息记录错误
    const INTEREST_IMPLEMENT_EXCEPTION              =  6004; //无计派息数据或无效
    const INTEREST_FUND_EXCEPTION                   =  6005; //平台账户余额不足
    const INTEREST_FUND_NOT_FOUND                   =  6008; // 平台账户不存在
    const INTEREST_FAIL_EXCEPTION                   =  6006; //派发利息失败
    const INTEREST_CALLBACK_EXCEPTION               =  6007; //银行存管回调失败
    const INTEREST_DUE_EXCEPTION               =  6009; //计息日不能大于等于到期日
	const STATION_SUBSIDY_EXCEPTION                   =  6010; //无补贴数据
    //
    // 6000 - 6999 异常 Code，仅供派息使用，其他模块请勿占用 END
    
    //7000 - 7999 异常 Code，仅供返本使用，其他模块请勿占用 START
    const REPAY_PARAM_EXCEPTION                     = 7001;//参数非法
    const REPAY_DATA_EXCEPTION                      = 7002; //无返本数据
    const REPAY_INVEST_DATA_STATUS_EXCEPTION      = 7003; //更新投资人返本计划表 dirp_status字段失败
    const ADVANCE_REPAY_DATA_EXCEPTION                      = 7004; //没有需要提前还款的数据
    const ADVANCE_REPAY_BALANCE_EXCEPTION                      = 7005; //提前还款余额不够
    //7000 - 7999 异常 Code，仅供返本使用，其他模块请勿占用 END

    // 8001 ～ 8999 供活动模块调用
    const ACTIVITY_COUPON_LOCK_FAILED               = 8001;
    const ACTIVITY_COUPON_NOT_EXISTS                = 8002;
    const ACTIVITY_COUPON_UNLOCK_FAILED             = 8003;
    const ACTIVITY_COUPON_USE_FAILED                = 8004;
    const ACTIVITY_COUPON_USE_WITHOUT_REL           = 8005; // 用券未关联投资
    const ACTIVITY_COUPON_USE_TWICE                 = 8006; // 这个关联已经用过券了
    const ACTIVITY_COUPON_CANNOT_USE                = 8007; // 火券不可用
    const ACTIVITY_NOT_EXISTS                       = 8008; // 活动不存在
    const ACTIVITY_HAS_END                          = 8009; // 活动已结束
    const ACTIVITY_HAS_NOT_BEGIN                    = 8010; // 活动未开始
    const ACTIVITY_NOT_SUPPORT                      = 8011; // 不支持的活动
    const ACTIVITY_RECOMMENDER_DOES_NOT_EXISTS      = 8012; // 邀请码错误
    const ACTIVITY_RECOMMEND_NOT_EXISTS             = 8013; // 邀请活动不存在
    const ACTIVITY_PWD_ERROR_PWD                    = 8014; // 错误的口令
    const ACTIVITY_CURRENCY_NOT_ENOUGH              = 8015; // 虚拟货币不足
    const ACTIVITY_INIT_CURRENCY_FAIL               = 8016; // 虚拟币初始化失败
    const ACTIVITY_HAS_SIGN_IN                      = 8017; // 今日已经签到过
    const ACTIVITY_SIGN_IN_FAIL                     = 8018;// 今日签到失败
    const ACTIVITY_HAS_GET                          = 8019; // 活动已经参与过了
    const ACTIVITY_HAS_OVER_TIMES                   = 8020; // 活动参与次数到达上限
    const ACTIVITY_EXPERIENCE_INVEST_ERROR          = 8021;  // 体验标投资失败
    const ACTIVITY_EXEC_FAIL                        = 8022; //活动执行失败
    const ACTIVITY_HAS_USED_COUPON                  = 8023; // 投资已使用过火券
    const ACTIVITY_COUPON_HAS_EXPIRED               = 8024; // 火券已过期
    const ACTIVITY_COUPON_RULE_NOT_MATCH            = 8025; // 火券规则不匹配
    const ACTIVITY_PRIZE_HAS_RECIEVED               = 8026; // 奖励已领取
    const ACTIVITY_PRIZE_RECIEVE_FAILED             = 8027; // 部分奖励领取失败
    const ACTIVITY_SHARE_GET_SELF                   = 8028; //分享领取不能是自己
    const ACTIVITY_SHARE_TOKEN_EXPIRED              = 8029; //分享token过期，请重新分享。
    const ACTIVITY_SIGN_INVEST_NOT_ENOUGH           = 8030; //在投金额不满足条件，无法签到。
    const Activit_NOT_BIND                     	    = 8031; //活动没有绑定任何奖品
    const Activit_COUPON_SEHNG                  	 = 8032; //使用过圣券不能再使用其他加息券了
    const Activit_COUPON_OUT                       = 8033; //已经加息到上限
    const ACTIVITY_COUPON_NOT_INVEST               =8034;//未投资零火宝不能使用加息券

    //    // 8000 ~ 8999 活动使用错误码 END
    

    // 90000 - 99990 异常 Code，仅供第三方系统使用，其他模块请勿占用 START
    const BAOFOO_SMSCODE_ERROR                           = 90000; // 短信验证码错误
    const BAOFOO_INFO_ERROR                              = 90130; // 信息有误
    const BAOFOO_THIRD_ERROR                             = 90020; // 第三方平台异常
    const BAOFOO_TRADE_ERROR                             = 90030; // 交易失败
    const BAOFOO_SYSTEM_ERROR                            = 90040; // 系统异常
    const BAOFOO_ALREADY_HAS_BIND_RELATION               = 91000; //已经存在绑定关系
    const BAOFOO_BIND_CARD_ERROR                         = 91010; //绑卡失败
    const BAOFOO_BIND_RELATION_NOT_EXIST                 = 91020; //绑定关系不存在
    const BAOFOO_RECHARGE_SMS_ERROR                      = 91030; //充值发送短信接口发生错误
    const BAOFOO_CONFIRM_RECHARGE_ERROR                  = 91040; //确认充值接口发生错误
    const BAOFOO_STORE_BIND_INFO_ERROR                   = 91050; //储存绑卡信息错误
    const BAOFOO_INSERT_WITHDRAW_INFO_ERROR              = 91060; //新增提现请求失败
    const BAOFOO_PARAMS_VALIDATE_ERROR                   = 91070; //参数验证错误
    const BAOFOO_STORE_PRERECHARGE_ERROR               = 91080; //预充值储存宝付充值信息错误
    const BAOFOO_RECHARGE_ERROR                          = 91090; //宝付充值返回错误信息
    const BAOFOO_BIND_NEED_REALNAME_AUTHENTICATE_ERROR   = 91100; //绑卡需要实名认证
    const BIND_INFO_NOT_EXIST                            = 91110; //绑卡信息表无此绑卡信息
    const USER_REALNAME_AUTHENTICATE_ERROR               = 91120; //用户未实名认证
    const BAOFOO_UNBIND_CARD_ERROR                       = 91130; //绑卡失败
    const BAOFOO_UPDATE_BIND_INFO_ERROR                  = 91140; //更新绑卡信息错误
    const BAOFOO_WITHDRAW_REQUEST_ERROR                  = 91150; //请求宝付提现接口失败
    const BAOFOO_WITDHDRAW_NOT_FOUND                     = 91160; //提现记录不存在
    const BAOFOO_WITDHDRAW_AMOUNT_LIMIT_ERROR            = 91170; //提现超出额度
    const BAOFOO_WITDHDRAW_TIMES_LIMIT_ERROR             = 91180; //提现次数的超额
    const BAOFOO_WITDHDRAW_REQUEST_TOO_MUCH             = 91180; //提现频率过快
    const USER_LOCK_ERROR                                = 91190; // 用户已经被锁定
    const BAOFOO_GET_CARDINFO_FAILURE                    = 91200; //获取银行卡信息失败
    const BANKCARD_INFO_ERROR                           = 91210; //银行卡信息无效
    const BAOFOO_UPDATE_WITHDRAW_REQUEST_ERROR           = 91220; //提现请求成功，更新数据失败
    const BAOFOO_RECHARGE_OK_STORE_FAIL_ERROR              = 91230; //宝付充值成功，但是储存失败
    const BAOFOO_RECHARGE_FAIL_AND_STORE_ERROR              = 91240; //宝付充值失败，同时存表失败
    const BAOFOO_WITHDRAW_SHOULD_BE_COMPANY_ERROR              = 91250; //提现用户非企业
    const BAOFOO_BANKCARD_NOT_RECOGNIZABLE               = 91260; // 卡无法识别
    const BAOFOO_UPDATE_PRERECHARGE_ERROR                = 91270; //预充值请求宝付成功，更新数据库失败
    const BAOFOO_RECHARGE_QUERY_RESULT_ERROR             = 91280; //查询充值，请求宝付失败
    const BAOFOO_DIRECT_BINDCARD_OK_STORE_ERROR          = 91290; //宝付直接绑卡成功，存数据库失败
    const BAOFOO_PRE_BINDCARD_OK_STORE_ERROR             = 91300; //宝付预绑卡成功，存数据库失败
    const PREBIND_INFO_NOT_EXIST                         = 91310; //预绑卡信息不存在

    const BAOFOO_CURL_FAIL                               = 91311; //baofoo curl请求失败
    const BAOFOO_BIND_SMS_ERROR                          = 91312; //绑卡短信验证失败
    const RECHARGE_RECORD_NOT_EXIST                      = 91313; //充值记录不存在
    const BANK_INFO_VALIDATE_ERROR                      = 91314; //充值记录不存在
    const PRERECHARGE_FAIL                                = 91320; //预充值失败
    const WITHDRAW_ALREADY_ON_THE_WAY                     = 91321; //已经有提现记录
    const DELETE_PREBIND_INFO_FAIL                      = 91322; //删除预绑卡信息失败
    const FESTIVAL_WITHDRAW_HALT                        = 91323; //节假日 不能提现
    const WITHDRAW_WITHOUT_RECHARGE_RECORD             = 91324; //提现时查询不到充值记录
    const NEW_GUY_WITHDRAW_LIMIT                       = 91325; //新人第一次充值当天，不能提现
    const BANK_LOAN_TO_SELF                              = 92010; // 不能放款给自己
    const BANK_LOAN_CONFLICT                             = 92020; // 订单重复放款
    const BANK_LOAN_AMOUNT_ZERO                          = 92030; // 放款金额不足一分钱
    const BANK_LOAN_AMOUNT_NEG_NUM                       = 92040; // 放款金额不能为负数
    const BANK_LOAN_FEE_NEG_NUM                          = 92050; // 放款手续费不能为负数
    const BANK_QUERY_WEB_RESULT_PARAMS_ERROR             = 92056; //查询银行自有页面发起的接口参数验证错误
    const REQUEST_RISK_FAIL                          = 92051; // 请求风控失败
    const CONFIRM_RECHARGE_FAIL                          = 91324; //预充值失败
    const REG_PWD_ERROR                                 = 91325; //密码设置正则不匹配

    //
    
    const INSIDE_KEY_MIMSMATCH                           = 10001; //内部接口KEY校验失败
    const INSIDE_KEY_NOT_PROVIDED                        = 10002; //内部接口未提供KEY

    //11开头的 用户专用
    const ID_CARD_ALREADY_USED_IN_REALNAME              =110001;//身份证已经被实名认证
    const REALNAME_REQUEST_DOWN                          =110002;//实名认证请求服务器失败


    // 12开头的供放款使用
    const LOAN_DATD_NO                        =12000;//无放款数据
    const LOAN_CALLBACK_FAIL                  =12001;//银行回调失败




    public static $errorMessages = [

        self::HTTP_NOT_FOUND                     => '请求的URL不存在',
        self::PUSH_TO_QUEUE_FAILED               => '入队失败',
        self::PARAMS_MISSING                     => '参数缺失',
        self::DATA_ABNORMAL                      => '数据异常',
        self::HTTP_METHOD_OPTION                 => '',
        self::BLACK_LIST_USER                    => '该用户已经被锁定，详情请联系客服',
        self::FORBID_NIGHT_TRADE                 => '非交易时间(晚上23点至第二日上午9点)，不支持此操作',
        self::SYS_MAINTAIN                       => '维护模式',
        self::SYS_FORCE_UPGRADE                  => '强制更新',
        self::SYS_FORCE_UPGRADE                  => '强制更新',

        // 2000 - 2999 短信模块使用 START
        self::ERR_SMS_CAPTCHA_MAX_DAY               => '超过每天验证码发送上线',
        self::ERR_SMS_CAPTCHA_FREQUENCE             => '短信验证码发送请求过于频繁',
        self::ERR_SMS_CAPTCHA_SEND_ERROR            => '调用短信接口发送验证码失败',
        self::ERR_SMS_CAPTCHA_OVERDUE               => '短信验证码已经过期',
        self::ERR_SMS_CAPTCHA_MAX_ERROR_TIMES       => '短信验证码超过最大错误次数,请重新获取',
        self::ERR_SMS_CAPTCHA_INCORRECT             => '短信验证码错误',
        self::ERR_SMS_PHONE_MISSING                 => '手机号码缺失',
        self::ERR_SMS_PHONE_ERROR                   => '手机号码非法',
        self::ERR_SMS_PHONE_EXISTED                 => '手机号码已存在',
        self::ERR_SMS_TYPE_ERROR                    => '短信类别非法',
        self::ERR_SMS_TYPE_MISSING                  => '短信类别缺失',
        self::ERR_SMS_TYPE_PARAMETER_ERROR          => '短信参数格式非法',
        self::ERR_SMS_TYPE_PARAMETER_MISSING        => '短信类别缺失',
        self::ERR_SMS_TYPE_TEMPLATE_MISSING         => '短信模版缺失',
        self::ERR_SMS_CAPTCHA_ERROR                 => '短信验证码错误',
        self::ERR_SMS_SEND_RECORD_ERROR             => '短信验证码已失效，请重新发送',
        self::ERR_SEND_SMS_FAILED                   => '短信验证码发送失败',
        self::ERR_READ_MESSAGE_FIELD                => '站内信不存在或已读',
        self::ERR_SMS_IN_BLACKLIST                  => '验证码发送失败，手机号码在黑名单',
        self::ERR_MESSAGE_NOT_FIND                  => '无消息',
        self::PASSWORD_FAILD_FIVE_TIMES             => '密码错误次数超过5次，半小时内无法登录',        // 2000 - 2999 短信模块使用 END
        self::ERR_SMS_PHONE_NOT_EXISTS              => '手机号码不存在',

        // 3000 - 3999债权交易模块异常占用 START
        self::DEBT_INVEST_FAILED                        => '投资失败',
        self::DEBT_PRODUCT_PLAN_UNVAILABLE              => '计划不可投',
        self::DEBT_PRODUCT_PLAN_NOT_ENOUGH              => '计划额度不足',
        self::DEBT_PRODUCT_PLAN_AMOUNT_TOO_SMALL        => '投资额度过小',
        self::DEBT_PRODUCT_PLAN_AMOUNT_TOO_LARGE        => '投资额度过大',
        self::DEBT_PRODUCT_PLAN_AMOUNT_NOT_ALLOW        => '投资额度必须是%s的倍数',
        self::DEBT_BORROWER_NOT_FOUND                   => '借款人没找到',
        self::DEBT_BORROWER_ALREADY_EXISTS              => '借款人已存在',
        self::DEBT_CONTRACT_NUMBER_CONFLICTED           => '借款合同已存在',
        self::DEBT_TRADE_ORDER_NOT_FOUND                => '投资订单未找到',
        self::DEBT_TRADE_ORDER_MATCH_COMPLETE           => '投资订单已撮合完成',
        self::DEBT_TRADE_ORDER_CAN_NOT_TO_MATCH         => '投资订单状态不是待撮合',
        self::DEBT_TRADE_ORDER_TO_MATCH_SUCCESS         => '投资订单状态不是撮合成功',
        self::DEBT_TRADE_ORDER_BANK_SYNC_FAILED         => '投资订单存管同步告知失败',
        self::DEBT_POOL_CHANGE_STATUS_FAILED            => '债权份额状态变更失败',
        self::DEBT_ONLINE_PARAM_INCORRECT               => '债权上线参数错误',
        self::DEBT_PRODUCT_YIELD_NOT_IN_SECTION         => '计划利率不在区间之内',
        self::DEBT_ONLINE_TO_REL_FAILED                 => '债权上线加入Rel表失败',
        self::DEBT_ONLINE_GEN_REPAY_PLAN_FAILED         => '债权上线生成还款计划失败',
        self::DEBT_ONLINE_ADD_PRODUCT_AMOUNT_FAILED     => '债权上线新增计划(产品)剩余金额失败',
        self::DEBT_ONLINE_CHANGE_STATE_FAILED           => '债权上线更新债权到状态到上线(募集中)状态失败',
        self::DEBT_ONLINE_NO_CORRECT_DEBTS              => '没有满足条件的债权可用于上线',
        self::DEBT_CANNOT_LOAN                          => '债权未找到或不符合放款条件',
        self::DEBT_NO_POOL_TO_LOAN                      => '没有找到可放款的认购份额',
        self::DEBT_REPAY_PLAN_CALC_FAILED               => '计算还款计划错误',
        self::DEBT_REPAY_PLAN_LIST_CALC_FAILED          => '计算还款计划列表错误',
        self::DEBT_MATCH_FAILED                         => '债权匹配失败',
        self::DEBT_NO_BESPEAK_POWER                     => '没有预约权限',
        self::DEBT_FILLIN_WITH_NOTHING                  => '生成债权时数据丢失',
        self::DEBT_TRADE_NOT_EXISTS                     => '投资订单不存在',
        self::DEBT_INVEST_HANDLE_EXC_FAST               => '投资订单处理过快',
        self::DEBT_NOT_FULL                             => '债权还未募集满',
        self::DEBT_INVEST_TRANSFER_NOT_FOUND            => '无债转记录',
        self::DEBT_PRODUCT_NO_RECORD                    => '没有此产品计划',
        self::DEBT_NO_RECORD                            => '债权表无记录',
        self::DEBT_USER_IS_NOT_BORROWER                 => '用户非借款人',
        self::DEBT_PRINCIPAL_OR_PERIODS_OR_RATE_OR_AGENCY_RATE_ERROR => '债权的本金或期数或利率或机构费率有问题',
        self::DEBT_PAYBACK_COM_PERIOD_CANNOT_BE_GREATER_THAN_LOAN_DAYS => '混合借款时, 债权的首类还款期数不可以大于借款天数的自然月数',
        self::DEBT_AUDIT_STATUS_NOT_WAITING             => '债权非待审核状态',
        self::DEBT_NOT_FOUND                            => '债权未找到',
        self::LIQUID_INVEST_STOPED                      => '零火宝已暂停预约',
        // 3000 - 3999债权交易模块异常占用 END

        // 4000 - 4999 资金账户异常占用 START
        self::ACCOUNT_MODULE_EXCEPTION                  => 'Account模块异常',
        self::ACCOUNT_MODULE_PARAMS_MISSING             => '参数缺失或非法',
        self::ACCOUNT_NOT_EXIST                         => '资金账户不存在',
        self::ACCOUNT_LOG_FLOW_NOT_ALLOWED              => '资金操作流向非法',
        self::ACCOUNT_LOG_CHANGE_MONEY_ILLEGAL          => '操作资金非法，变动金额不能小于0或为空',
        self::ACCOUNT_FROZEN_MONEY_ILLEGAL              => '冻结资金非法',
        self::ACCOUNT_FROZEN_MONEY_ORDER_ID_NOT_EXIST   => '冻结资金平台订单号不存在',
        self::ACCOUNT_FROZEN_MONEY_UNFREEZE_FAIL        => '解扣冻结资金失败',
        self::ACCOUNT_FROZEN_MONEY_UNFREEZE_EXCEED      => '解扣冻结资金异常超额',
        self::ACCOUNT_AVAIL_MONEY_LESS                  => '可用资金不足以操作',
        self::ACCOUNT_FROZEN_MONEY_LESS                 => '冻结资金不足以操作',
        self::ACCOUNT_INVESTED_MONEY_LESS               => '在投资金不足以操作',
        self::ACCOUNT_DICT_ITEM_NOT_IN_WHITE_LIST       => '资金字典值不在白名单范围内',
        self::ACCOUNT_DB_OPERATION_ERROR                => '资金账户数据库读写异常',
        self::ACCOUNT_INVEST_MONEY_LESS                 =>'已投余额不足',
        self::ACCOUNT_ZT_MONEY_LESS                     =>'在途余额不足',
        self::ACCOUNT_ARRIVAL_MONEY_LESS                =>'到账余额不足',



        self::ACCOUNT_PASSWORD_MISSMATCH              => '账号密码不匹配',
        self::ACCOUNT_LOGIN_NOT_FOUND                 => '登录账号不存在',
        self::ACCOUNT_USER_NOT_FOUND                  => '用户不存在',
        self::ACCOUNT_USER_NOT_LOGIN                  => '您未登录或登录已失效，请重新登录',
        self::NOT_LOGIN                                => '您未登录或登录已失效，请重新登录',
        self::ACCOUNT_WRONG_CAPTCHA                   => '图形验证码错误',
        self::ACCOUNT_CHALLENGE_MAX_CAPTCHA           => '图形验证码失败超过最大次数，请重新加载新的图形验证码',
        self::ACCOUNT_ALREADY_REALNAME                => '您已有实名绑卡信息，请联系客服',
        self::ACCOUNT_PAYPWD_ILLEGAL_FORMAT           => '支付密码长度小于6位',
        self::ACCOUNT_PAYPWD_OPERION_FAIL             => '修改支付密码操作失败',
        self::REALNAME_TIMES_LIMIT             => '实名认证请求次数超限',

        self::ACCOUNT_PREFER_OPERATION_FAIL             => '提交投资偏好结果失败',
        self::USER_WITHDRAW_NO_RECORD                   => '无提现记录',
        self::ACCOUNT_BANK_CARD_LIMIT_NO_RECORD     => '无银行限额记录',
        self::USER_REGISTER_IDNUM_EXISTED             => '身份证号已存在',
        self::USER_KICKED                             => '您的账号在其他设备登录，如非本人操作，请修改密码保证账户资金安全。',
        self::USER_MOBILE_EXIST                          => '手机号已被占用',
        self::USER_NO_NEED_FOR_CAPTCHA                   => '不需要图形验证',
        self::BORROWER_AGENCY_NOT_EXIST                   => '借款人对应机构不存在',
        self::BORROWER_OPENACCOUNT_PARAMS_ERROR       =>'ump开户接口参数非法，type不存在',
        self::ADD_AGENCY_FAIL                       => '添加机构失败',
        self::BLACK_LIST_USER                            => '该用户已经被锁定，详情请联系客服',
        self::REALNAME_TIMES_LIMIT                       => '实名认证次数超限',
        self::OPEN_BETA_FORBIDDEN_REGISTER               => '公测期间暂停注册，敬请谅解',

        // 4000 - 4999 资金账户异常占用 END

        // 5000 - 5999 结算系统异常占用 START
        self::Maximoff_MODULE_EXCEPTION                 => 'Maximoff模块异常',
        self::Maximoff_MODULE_PARAMS_MISSING            => '参数缺失或非法',

        // 5000 - 5999 结算系统异常占用 END

        // 6000 - 6999 派息异常占用 START
        self::INTEREST_PARAM_EXCEPTION                  => '参数缺失或非法',
        self::INTEREST_DATA_EXCEPTION                   => '无计息数据',
        self::INTEREST_CREATE_EXCEPTION                 => '生成计息记录错误',
        self::INTEREST_IMPLEMENT_EXCEPTION              => '无派息数据或无效',
        self::INTEREST_FUND_EXCEPTION                   => '平台账户余额不足',
        self::INTEREST_FAIL_EXCEPTION                   => "派发利息是失败",
        self::INTEREST_CALLBACK_EXCEPTION               => "银行存管回调失败",
        self::INTEREST_FUND_NOT_FOUND                   => '平台红包户不存在，请创建一个ui_id=100的红包户',
        self::INTEREST_DUE_EXCEPTION               =>  '计息日不能大于等于到期日',

        // 6000 - 6999 派息异常占用  END

        // 7000 - 7999 返本异常占用 START
        self::REPAY_PARAM_EXCEPTION                     => '参数缺失或非法',
        self::REPAY_DATA_EXCEPTION                      => '无返本数据',
        self::ADVANCE_REPAY_DATA_EXCEPTION  => '无提前还款的数据',
        self::ADVANCE_REPAY_BALANCE_EXCEPTION => '提前还款余额不够',
        // 7000 - 7999 返本异常占用  END

        // 8000 ~ 8999 活动使用错误码 START
        self::ACTIVITY_NOT_EXISTS                       => '活动不存在',
        self::ACTIVITY_HAS_END                          => '活动已结束',
        self::ACTIVITY_HAS_NOT_BEGIN                    => '活动未开始',
        self::ACTIVITY_NOT_SUPPORT                      => '不支持的活动',
        self::ACTIVITY_COUPON_LOCK_FAILED               => '火券锁定失败',
        self::ACTIVITY_COUPON_UNLOCK_FAILED             => '火券解锁失败',
        self::ACTIVITY_COUPON_NOT_EXISTS                => '火券不存在',
        self::ACTIVITY_COUPON_USE_FAILED                => '火券使用失败',
        self::ACTIVITY_RECOMMENDER_DOES_NOT_EXISTS      => '邀请码错误',
        self::ACTIVITY_COUPON_USE_WITHOUT_REL           => '用券未关联',
        self::ACTIVITY_COUPON_USE_TWICE                 => '已经用过券了',
        self::ACTIVITY_COUPON_CANNOT_USE                => '火券不可用',
        self::ACTIVITY_PWD_ERROR_PWD                    => '错误的口令',
        self::ACTIVITY_CURRENCY_NOT_ENOUGH              => '虚拟货币不足',
        self::ACTIVITY_INIT_CURRENCY_FAIL               => '虚拟货币初始化失败',
        self::ACTIVITY_HAS_SIGN_IN                      => '今日已经签到过',
        self::ACTIVITY_SIGN_IN_FAIL                     => '签到失败',
        self::ACTIVITY_HAS_GET                       => '已经参与过活动了',
        self::ACTIVITY_HAS_OVER_TIMES                   =>'活动参与次数到达上限',
        self::ACTIVITY_EXPERIENCE_INVEST_ERROR          => '体验标投资异常',
        self::ACTIVITY_HAS_USED_COUPON                  => '投资已使用火券',
        self::ACTIVITY_COUPON_HAS_EXPIRED               => '火券已过期',
        self::ACTIVITY_COUPON_RULE_NOT_MATCH            => '火券使用不满足规则',
        self::ACTIVITY_EXEC_FAIL                        => '活动执行失败',
        self::ACTIVITY_PRIZE_HAS_RECIEVED               => '奖励已领取',
        self::ACTIVITY_PRIZE_RECIEVE_FAILED             => '奖品 %s 领取失败，请重试',
        self::ACTIVITY_SHARE_GET_SELF                   => '分享领取不能是自己',
        self::ACTIVITY_SHARE_TOKEN_EXPIRED              => '分享token过期，请重新分享。',
        self::ACTIVITY_SIGN_INVEST_NOT_ENOUGH           => '在投金额不满足条件，无法签到。',
        self::Activit_COUPON_SEHNG                      => '已经使用了圣券',
        self::Activit_COUPON_OUT                     => '您加息超过上限了',
        self::ACTIVITY_COUPON_NOT_INVEST               => '请投资零火宝再使用',


        // 8000 ~ 8999 活动使用错误码 END

        self::BAOFOO_SMSCODE_ERROR                           => '短信验证码错误',
        self::BAOFOO_INFO_ERROR                              => '信息有误',
        self::BAOFOO_THIRD_ERROR                             => '第三方平台异常',
        self::BAOFOO_TRADE_ERROR                             => '交易失败',
        self::BAOFOO_SYSTEM_ERROR                            => '系统异常',
        self::BAOFOO_ALREADY_HAS_BIND_RELATION               => '用户已绑卡',
        self::BAOFOO_BIND_CARD_ERROR                         => '绑卡失败',
        self::BAOFOO_BIND_RELATION_NOT_EXIST                 => '绑定关系不存在',
        self::BAOFOO_RECHARGE_SMS_ERROR                      => '充值发送短信接口发生错误',
        self::BAOFOO_CONFIRM_RECHARGE_ERROR                  => '确认充值接口发生错误',
        self::BAOFOO_STORE_BIND_INFO_ERROR                   => '储存绑卡信息错误',
        self::BAOFOO_INSERT_WITHDRAW_INFO_ERROR              => '新增提现请求失败',
        self::BAOFOO_PARAMS_VALIDATE_ERROR                   => '参数验证错误',
        self::BAOFOO_STORE_PRERECHARGE_ERROR              => '预充值储存宝付充值信息错误',
        self::BAOFOO_RECHARGE_ERROR                          => '宝付充值返回错误信息',
        self::BAOFOO_BIND_NEED_REALNAME_AUTHENTICATE_ERROR   => '绑卡需要实名认证',
        self::BIND_INFO_NOT_EXIST                            => '绑卡信息表无此绑卡信息',
        self::USER_REALNAME_AUTHENTICATE_ERROR               => '用户没有实名认证',
        self::BAOFOO_UNBIND_CARD_ERROR                       => '绑卡失败',
        self::BAOFOO_UPDATE_BIND_INFO_ERROR                  => '更新绑卡信息错误',
        self::BAOFOO_WITHDRAW_REQUEST_ERROR                  => '请求宝付提现接口失败',
        self::BAOFOO_WITDHDRAW_NOT_FOUND                     => '提现记录不存在',
        self::BAOFOO_GET_CARDINFO_FAILURE                    => '获取银行卡信息失败',
        self::BANKCARD_INFO_ERROR                            => '银行卡信息无效',
        self::BAOFOO_RECHARGE_OK_STORE_FAIL_ERROR           =>'宝付充值成功，但是储存失败',
        self::BAOFOO_RECHARGE_FAIL_AND_STORE_ERROR           =>'宝付充值失败，同时存表失败',
        self::BAOFOO_RECHARGE_FAIL_AND_STORE_ERROR           =>'宝付提现请求失败，提现用户非企业',
        self::BAOFOO_BANKCARD_NOT_RECOGNIZABLE               => '银行卡无法识别或不支持绑定该卡',
        self::WITHDRAW_ALREADY_ON_THE_WAY                     => '此放款已有处理中或处理成功的记录',
        self::DELETE_PREBIND_INFO_FAIL                     => '删除预绑卡信息失败',
        self::BAOFOO_WITDHDRAW_REQUEST_TOO_MUCH             => '提现请求频率过快',

        self::BANK_LOAN_TO_SELF                              => '不能放款给自己',
        self::BANK_LOAN_CONFLICT                             => '订单重复放款',
        self::BANK_LOAN_AMOUNT_ZERO                          => '放款金额不足一分钱',
        self::BANK_LOAN_AMOUNT_NEG_NUM                       => '放款金额不能为负数',
        self::BANK_LOAN_FEE_NEG_NUM                          => '放款手续费不能为负数',

        self::INSIDE_KEY_MIMSMATCH                      => '内部接口KEY校验失败',
        self::INSIDE_KEY_NOT_PROVIDED                   => '内部接口未提供KEY',

        //11000-11999 异常code ， 仅供用户模块使用
        self::ID_CARD_ALREADY_USED_IN_REALNAME           =>'该身份证已经被其他账号实名认证',
        self::REALNAME_REQUEST_DOWN           =>'实名认证curl请求失败',

        // 12开头的供放款使用
        self::LOAN_DATD_NO                    =>"无放款数据",
        self::LOAN_CALLBACK_FAIL              =>"银行回调失败",

        self::USER_INFO_NOT_FINISHED =>"用户信息没有完善",
        self::API_DELETED                     => "接口已停止使用",
    ];



}
